package Server.Dwc.cqssc;

import java.util.Arrays;
import net.sf.json.*;
class IJsonExport {
	public String toString() {
		return getJsonData();
	}

	private String getJsonData() {
		return "";
	}

	public static String sprintf_BYTE(int by[][], int count) {
		int number = 0;
		int tmpCardData[] = new int[count]; // �û��˿�
		for (int i = 0; i < by.length; i++) {
			for (int k = 0; k < by[i].length; k++) {
				tmpCardData[number] = by[i][k];
				number++;
			}
		}
		String strCardData = sprintf_BYTE(tmpCardData, count);
		return strCardData;
	}

	public static String sprintf_BYTE(Integer by[][], int count) {

		int tmpCardData[] = new int[count]; // �û��˿�
		for (int i = 0; i < by.length; i++) {
			for (int k = 0; k < by[i].length; k++) {
				tmpCardData[i * by.length + k] = by[i][k];
			}
		}
		String strCardData = sprintf_BYTE(tmpCardData, count);
		return strCardData;
	}

	public static String sprintf_BYTE(Integer by[], int count) {
		return sprintf_INT32(by, count);
	}

	public static String sprintf_BYTE(int by[], int count) {
		return sprintf_INT32(by, count);
	}

	public static String sprintf_DWORD(int dw[], int count) {
		return sprintf_INT32(dw, count);
	}

	public static String sprintf_INT32(Integer dw[], int count) {
		if (count < 1) {
			return "";
		}
		StringBuffer out_str = new StringBuffer();
		out_str.append(dw[0]);
		for (int i = 1; i < count; i++) {
			out_str.append(",");
			out_str.append(dw[i]);
		}
		return out_str.toString();
	}

	public static String sprintf_DOUBLE(double dw[], int count) {
		if (count < 1) {
			return "";
		}
		StringBuffer out_str = new StringBuffer();
		out_str.append(dw[0]);
		for (int i = 1; i < count; i++) {
			out_str.append(",");
			out_str.append(dw[i]);
		}
		return out_str.toString();
	}

	public static String sprintf_INT32(int dw[], int count) {
		if (count < 1) {
			return "";
		}
		StringBuffer out_str = new StringBuffer();
		out_str.append(dw[0]);
		for (int i = 1; i < count; i++) {
			out_str.append(",");
			out_str.append(dw[i]);
		}
		return out_str.toString();
	}
}

/***
 * ���������뷿��
 */
class SUBCMD_S_Connect extends IJsonExport {

	int m_lUid;

	String getJsonData() {
		String hbmsg = String.format("connect|%d", m_lUid);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_Join extends IJsonExport {

	int m_lUid;

	String getJsonData() {

		String hbmsg = String.format("join|%d", m_lUid);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

// �뿪����֪ͨ
class SUBCMD_S_Leave extends IJsonExport {

	int m_lUid;// ���ID

	String getJsonData() {

		String hbmsg = String.format("leave|%d", m_lUid);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

// �뿪����֪ͨ
class SUBCMD_S_Offline extends IJsonExport {

	int m_lUid;// ���ID

	String getJsonData() {

		String hbmsg = String.format("offline|%d", m_lUid);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_CreateRoom extends IJsonExport {

	int cbResult;
	int cbRound;
	int m_wUserChairID;// ��λID
	int m_dwTableID;// ����ID

	String getJsonData() {

		String hbmsg = String.format("createroom|%d|%d|%d|%d", cbResult, cbRound, m_wUserChairID, m_dwTableID);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_Param extends IJsonExport {

	int m_dwTableID;
	String szParam;
	
	String getJsonData() {

		String hbmsg = String.format("param|%d|%s", m_dwTableID, szParam);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_TryDismissRoom extends IJsonExport {
	int lUid;
	String szNickName;//
	int dwTableID;// ����ID

	String getJsonData() {
		String hbmsg = String.format("try_dismissroom|%d|%s|%d", lUid, szNickName, dwTableID);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_AgreeDismissRoom extends IJsonExport {
	int lUid;
	String szNickName;//
	int dwTableID;// ����ID

	String getJsonData() {
		String hbmsg = String.format("agree_dismissroom|%d|%s|%d", lUid, szNickName, dwTableID);

		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_RefuseDismissRoom extends IJsonExport {
	int lUid;
	String szNickName;//
	int dwTableID;// ����ID

	String getJsonData() {
		String hbmsg = String.format("refuse_dismissroom|%d|%s|%d", lUid, szNickName, dwTableID);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_DismissRoom extends IJsonExport {
	int cbResult;
	int lUid;
	int m_wUserChairID;// ��λID
	int m_dwTableID;// ����ID

	String getJsonData() {

		String hbmsg = String.format("dismissroom|%d|%d|%d|%d", cbResult, lUid, m_wUserChairID, m_dwTableID);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_JoinRoom extends IJsonExport {
	int lUid;
	int cbResult;
	int dwTableID;// ����ID
	int cbRound;
	int byParam[] = new int[20];
	String szGameName;
	String szGameDesc;
	
	String getJsonData() {

		String strParam = Arrays.toString(byParam);
		strParam = strParam.substring(1, strParam.length() - 1);

		String hbmsg = String.format("joinroom|%d|%d|%d|%d|%s|%s|%s", lUid, cbResult, dwTableID, cbRound, strParam,
				szGameName, szGameDesc);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_AvatarURL extends IJsonExport { 		
	int	lUid;  
	String szURL;

	String getJsonData() {

		String hbmsg = String.format("avatar|%d|%s", lUid, szURL);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_Sit extends IJsonExport{		
	int	 m_lUid;      	
	int	 m_wUserChairID;//��λID 
	int	 m_dwTableID;//����ID
	int	 m_lUserScore;
	String	szNickName;
	int	m_cbGender;
	int		m_iAvatar;
	String	szIP;
	int[] m_byRound = new int[5];
	double m_lUserCoin;
	
	String getJsonData() {
		String strM_byRound = sprintf_INT32(m_byRound, 5);
		
		String hbmsg = String.format("sit|%d|%d|%d|%d|%s|%d|%d|%s|%s|%g", m_lUid, m_wUserChairID, m_dwTableID,
				m_lUserScore, szNickName, m_cbGender, m_iAvatar, szIP,strM_byRound,m_lUserCoin);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);
		return json.toString();
	}
};

class SUBCMD_S_DenySit extends IJsonExport {
	int cbReason; // 1,û���ҵ�����,2����������

	String getJsonData() {

		String hbmsg = String.format("denysit|%d", cbReason);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_Look extends IJsonExport{ 
	int m_lUid;     	
	int m_wUserChairID;//����ID    	
	int m_iTotalCoin;
	String szNickName;

	String getJsonData() {

		String hbmsg = String.format("look|%d|%d|%d|%d|%s", m_lUid, m_wUserChairID, m_iTotalCoin, szNickName);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_StandUp extends IJsonExport {

	int m_lUid;// ���ID
	int m_wUserChairID;// ��λID
	int m_dwTableID;// ����ID

	String getJsonData() {

		String hbmsg = String.format("standup|%d|%d|%d", m_lUid, m_wUserChairID, m_dwTableID);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_Kick extends IJsonExport {

	int m_lUid;// ���ID
	int m_wUserChairID;// ��λID
	int m_dwTableID;// ����ID

	String getJsonData() {

		String hbmsg = String.format("kick|%d|%d|%d", m_lUid, m_wUserChairID, m_dwTableID);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_Ready extends IJsonExport {
	int m_lUid;// ���ID
	int m_wUserChairID;// �����λ
	int m_dwTableID;// ����ID
	int[] m_byRound = new int[5];
	
	String getJsonData() {

		String strM_byRound = sprintf_INT32(m_byRound, 5);
		
		String hbmsg = String.format("ready|%d|%d|%d|%s", m_lUid, m_wUserChairID, m_dwTableID,strM_byRound);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);
		return json.toString();
	}
};

// �������
class SUBCMD_S_BiaoQing extends IJsonExport {
	int m_lUid;// �ĸ����ID���
	int m_wUserChairID;// �����λ
	int m_iBiaoQingIndex;

	String getJsonData() {

		String hbmsg = String.format("biaoqing|%d|%d|%d", m_lUid, m_wUserChairID, m_iBiaoQingIndex);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

// ����
class SUBCMD_S_YuYin extends IJsonExport {
	int m_lUid;// �ĸ����ID���
	int m_wUserChairID;// �����λ��
	int m_iYuYinIndex;

	String getJsonData() {

		String hbmsg = String.format("yuyin|%d|%d|%d", m_lUid, m_wUserChairID, m_iYuYinIndex);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

// ����
class SUBCMD_S_SongLi extends IJsonExport {
	int m_srcUid;// �ĸ����ID���
	int m_dstUid;// �����λ ��
	int m_iLiWu;
	int m_srcCoin;// ����������¶���Ǯ
	int m_dstCoin;// ����������¶���Ǯ

	String getJsonData() {

		String hbmsg = String.format("use|%d|%d|%d|%d|%d", m_srcUid, m_dstUid, m_iLiWu, m_srcCoin, m_dstCoin);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

// ����
class SUBCMD_S_Avatar extends IJsonExport {
	int m_lUid;// �ĸ����ID���
	String szAvatarURL;

	String getJsonData() {

		String hbmsg = String.format("avatar|%d|%s", m_lUid, szAvatarURL);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

class SUBCMD_S_Chat extends IJsonExport {
	int m_lUid;// �ĸ����ID���
	int m_wUserChairID;// �����λ��
	String szContent;
	String name;
	String getJsonData() {

		String hbmsg = String.format("chat|%d|%d|%s|%s", m_lUid, m_wUserChairID, szContent,name);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};

// ����
class SUBCMD_S_Voice extends IJsonExport {
	int m_lUid;// �ĸ����ID���
	int m_wUserChairID;// �����λ��
	int seconds;
	String szVoiceURL;

	String getJsonData() {

		String hbmsg = String.format("voice|%d|%d|%d|%s", m_lUid, m_wUserChairID, seconds, szVoiceURL);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}
};



class SSeatInfo {
	int m_lUid;// UID
	int m_lTotalScore;// COIN
	String m_NickName;// NICKNAME
	int m_iBetCoin;//
	int m_cbGender;//
	int m_iAvatar;//
	int m_cbUserStatus;// �û�״̬
	int m_iVipLevel;// VIP LEVEL
	int m_iTitle;// �ƺ�
	int m_isLookon;// �Ƿ����
	String szIP;
	double m_iTotalCoin;

	public String toString() {

		String hbmsg = String.format("%d#%d#%s#%d#%d#%d#%d#%d#%d#%d#%s#%g", m_lUid, m_lTotalScore, m_NickName, m_iBetCoin,
				m_cbGender, m_iAvatar, m_cbUserStatus, m_iVipLevel, m_iTitle, m_isLookon, szIP,m_iTotalCoin);
		return hbmsg;
	}
};

class SUBCMD_S_Table extends IJsonExport{ //ͬ�����������Ϣ
	int	 m_dwTableID;//����ID			
	int	m_bTableStarted;//ֻҪ��ʼ��
	int	m_byRound;//
	int	m_byMaxRound;//		
	int	m_bGameStarted;//��Ϸ��ʼ	
	int	m_cntUser;//�������
	int	m_cntLookon;//�������� 
	
	public SUBCMD_S_Table(){
		for (int i = 0; i < 1; i++) {
			 m_seatInfo[i] = new SSeatInfo();
		}
	}
	SSeatInfo	m_seatInfo[] = new SSeatInfo[1];
	public String getJsonData(){
		String hbmsg = String.format("table|%d|%d|%d|%d|%d|%d|%d|%s", m_dwTableID, m_bTableStarted, m_byRound, m_byMaxRound,m_bGameStarted, m_cntUser, m_cntLookon,
			m_seatInfo[0].toString());
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);	
		
		return json.toString();		
	}
};

class SUBCMD_S_STAGE extends IJsonExport { // ͬ�����������Ϣ
	String szStage;
	int m_byZhuang;// ��ǰׯλ��
	int m_wZhuangPower;// ��ǰׯ�ı���
	int needDealTime;
	int m_byQiangZhuang[] = new int[5]; // �Ƿ���ׯ������ׯ�ı���
	int m_byXiaZhu[] = new int[5]; // ÿ���˵���ע
	int m_byXuanNiu[] = new int[5]; // ÿ���˵���עm_Creator
	int m_bTableCardArray[][] = new int[5][2]; // �����˿� //been 5
	int m_vecCardType[] = new int[5];
	int m_vecRoundScore[] = new int[5];

	public String getJsonData(){
		String strQiangZhuang = sprintf_INT32(m_byQiangZhuang, 5);
		String strXiaZhu = sprintf_INT32(m_byXiaZhu, 5);
		String strXuanNiu = sprintf_INT32(m_byXuanNiu, 5);

		String strTableCard = sprintf_BYTE(m_bTableCardArray, 10);
		String strCardType = sprintf_BYTE(m_vecCardType, 5);
		String strRoundScore = sprintf_INT32(m_vecRoundScore, 5);
		
		String hbmsg = String.format("stage|%s|%d|%d|%d|%s|%s|%s|%s|%s|%s", szStage, m_byZhuang, m_wZhuangPower, needDealTime, strQiangZhuang, strXiaZhu, strXuanNiu, strTableCard, strCardType, strRoundScore);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);		
		return json.toString();
	}
};


class SUBCMD_S_REPORT extends IJsonExport {
	int cbReason;
	int whoDismiss;
	int vecMaxWinScore[] = new int[5];
	int vecWinScore[] = new int[5];
	int vecLoseScore[] = new int[5];
	double vecResultScore[] = new double[5];

	String getJsonData() {


		String strMaxWinScore = sprintf_INT32(vecMaxWinScore, 5);
		String strWinScore = sprintf_INT32(vecWinScore, 5);
		String strLoseScore = sprintf_INT32(vecLoseScore, 5);
		String strResultScore = sprintf_DOUBLE(vecResultScore, 5);

		String hbmsg = String.format("report|%d|%d|%s|%s|%s|%s", cbReason, whoDismiss, strMaxWinScore, strWinScore,
				strLoseScore, strResultScore);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();
	}

	String getData() {

		String strWinScore = sprintf_INT32(vecWinScore, 5);
		String strLoseScore = sprintf_INT32(vecLoseScore, 5);
		String strResultScore = sprintf_DOUBLE(vecResultScore, 5);

		return String.format("report|%d|%d|%s|%s|%s", cbReason, whoDismiss, strWinScore, strLoseScore, strResultScore);
	}
};

class SUBCMD_S_QiangZhuang extends IJsonExport {
	int lUid; // ��ǰ���
	int wChairID; // �����λ��
	int wPower; // ��ע���

	public String getJsonData() {

		String hbmsg = String.format("qiangzhuang|%d|%d|%d", lUid, wChairID, wPower);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();			
	}
};

class SUBCMD_S_DingZhuang extends IJsonExport{
	int		lUid;					//��ǰ���
	int 	wChairID;				//�����λ�� 
	int		wPower;					//��ע���
	int		byQiangZhuang[] = new int[5];		//��ׯ��ҵĶ�����Ҫ

	public String getJsonData(){

		String strQiangZhuang = sprintf_BYTE(byQiangZhuang, 5);
		
		String hbmsg = String.format("dingzhuang|%d|%d|%d|%s", lUid, wChairID, wPower, strQiangZhuang);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();	
		
	}
};

class SUBCMD_S_XiaZhuRev extends IJsonExport {
	int lUid;
	int success;
	String reason;
	double rmb;
	public String getJsonData() {
		String hbmsg = String.format("xiazhurev|%d|%d|%s|%g", lUid, success,reason, rmb);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", hbmsg);

		return json.toString();		
	}
};

class SUBCMD_S_VoiceMsg extends IJsonExport{
	int m_lUid;
	int m_wUserChairID;
	int m_maxClip;
	int m_currClip;
	float seconds;
	String data;
	
	String getJsonData() {

		String msg = String.format("voicemsg|%d|%d|%f|%s|%d|%d", m_lUid, m_wUserChairID, seconds, data,m_maxClip,m_currClip);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", msg);

		return json.toString();
	}
};

class SUBCMD_S_ExprMsg extends IJsonExport{
	int m_uid1;
	int m_uid2;
	int m_index;
	String getJsonData() {

		String sscmsg = String.format("expr|%d|%d|%d", m_uid1, m_uid2,m_index);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);

		return json.toString();
	}
};
class SUBCMD_S_InFore extends IJsonExport{
	int byActionUser;
	String getJsonData(){
		String niuniumsg = String.format("inFore|%d", byActionUser);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", niuniumsg);
		return json.toString();
	}
}

class SUBCMD_S_InBack extends IJsonExport{
	int byActionUser;
	String getJsonData(){
		String niuniumsg = String.format("inBack|%d", byActionUser);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", niuniumsg);
		return json.toString();
	}
}

class SUBCMD_S_OnLine extends IJsonExport{
	int uid;
	int seat;
	String getJsonData(){
		String sscmsg = String.format("online|%d|%d", uid,seat);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
}

class SUBCMD_S_GameIap extends IJsonExport{
	int uid;
	int seat;
	int coin;
	String getJsonData(){
		String sscmsg = String.format("gameiap|%d|%d|%d", uid,seat,coin);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
}
class SUBCMD_S_CurrStage extends IJsonExport{
	String m_curStage;
	int m_timeCountDown;
	String m_qiHao;
	int m_fengPanCountDown;
	int m_kaiJiangCountDown;	
	String getJsonData(){
		String sscmsg = String.format("currstage|%s|%d|%s|%d|%d", m_curStage,m_timeCountDown,m_qiHao,m_fengPanCountDown,m_kaiJiangCountDown);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
}
class SUBCMD_S_Sync_DownTime extends IJsonExport{
	int m_fengPanCountDown;
	int m_kaiJiangCountDown;
	String getJsonData(){
		String sscmsg = String.format("syncDownTime|%d|%d",m_fengPanCountDown,m_kaiJiangCountDown);
		JSONObject json = new JSONObject();
		json.put("command", "pk10msg");
		json.put("pk10msg", sscmsg);
		return json.toString();
	}
}
class SUBCMD_S_ChangeStage extends IJsonExport{
	String m_curStage;
	int m_timeCountDown;
	String m_qiHao;
	int m_fengPanCountDown;
	int m_kaiJiangCountDown;	
	String getJsonData(){
		String sscmsg = String.format("changestage|%s|%d|%s|%d|%d", m_curStage,m_timeCountDown,m_qiHao,m_fengPanCountDown,m_kaiJiangCountDown);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
}
class SUMBCMD_S_PrevResult extends IJsonExport{
	String m_qiHao;
	int []m_result = new int[5];
	int m_sum;
	String m_daXiao;
	String m_danShuang;
	String m_longHuHe;
	String m_nn;
	String getJsonData(){
		String result = sprintf_INT32(m_result,5);
		String sscmsg = String.format("prevResult|%s|%s|%d|%s|%s|%s|%s",m_qiHao, result,m_sum,m_daXiao,m_danShuang,m_longHuHe,m_nn);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
}
class SUBCMD_S_PeiLv extends IJsonExport{
	JSONObject m_config;
	String getJsonData(){
		String sscmsg = String.format("peilv|%s", m_config.toString());
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
}
class SUBCMD_S_OpenRed extends IJsonExport{
	int uid;
	String name;
	int success;
	String reason;
	double redJiner;
	int isLei;
	double peiJiner;
	String headurl;
	int leftRed;
	String getJsonData(){
		String sscmsg = String.format("openred|%d|%s|%d|%s|%g|%d|%g|%s|%d", uid,name,success,reason,redJiner,isLei,peiJiner,headurl,leftRed);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
}

class SUBCMD_S_JieSuan extends IJsonExport {
	int success;
	String result;
	double wons;
	double myRmb;
	String qihao;
	String zhongList;
	double wonlose;
	String getJsonData(){
		String sscmsg = String.format("jiesuan|%d|%s|%g|%g|%s|%s|%g", success,result,wons,myRmb,qihao,zhongList,wonlose);
		JSONObject json = new JSONObject();
		json.put("command", "cqsscmsg");
		json.put("cqsscmsg", sscmsg);
		return json.toString();
	}
};